package main

import "fmt"

func main() {
	scoreMap := make(map[string]int, 0)
	scoreMap["张三"] = 100
	scoreMap["李四"] = 70
	scoreMap["王五"] = 69
	fmt.Println(scoreMap)
	fmt.Println(scoreMap["张三"])
	//fmt.Println(scoreMap["小红"])
	fmt.Printf("type of scoreMap is %T\n", scoreMap)
	//fmt.Printf("%#v", scoreMap)

	value, ok := scoreMap["xiaoh"]
	if ok {
		fmt.Println("exist,and the value is", value)
	} else {
		fmt.Println("not exist")
	}
	//遍历
	for k, v := range scoreMap {
		fmt.Println(k, " ----> ", v)
	}
	delete(scoreMap, "赵六")
	fmt.Println()
	for k, v := range scoreMap {
		fmt.Println(k, " ----> ", v)
	}

	//类型别名
	type NewInt int

	var a NewInt
	fmt.Printf("a的类型为：%T\n", a)

	type typeInt = int
	var b typeInt
	fmt.Printf("b的类型为：%T\n", b)
}
